package com.simon.config;

import java.util.Properties;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import com.github.pagehelper.PageInterceptor;


/**
 * 分页插件的配置
 * @author Jiajie.Mao
 *
 */
@Configuration
public class PageHelperConfig {
	
	@Value("${pagehelper.helperDialect}")
	private String helperDialect;
	
	@Bean
	public PageInterceptor pageInterceptor() {
		PageInterceptor pageInterceptor = new PageInterceptor();
        Properties properties = new Properties();
        properties.setProperty("helperDialect", helperDialect);
        pageInterceptor.setProperties(properties);
        return pageInterceptor;
	}
}
